//
//  FirstCell.m
//  时尚男士
//
//  Created by dlios on 15-6-8.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "FirstCell.h"

@implementation FirstCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    //在这个视图中将第一个cell编辑好
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.firstImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:_firstImageView];

        self.firstButton = [UIButton buttonWithType:UIButtonTypeSystem];
        [_firstButton setTitle:@"专题" forState:UIControlStateNormal];
        _firstButton.backgroundColor = [UIColor redColor];
        _firstButton.titleLabel.font = [UIFont boldSystemFontOfSize:10.f];
        [self.contentView addSubview:_firstButton];
        
        self.firstLabel = [[UILabel alloc] init];
        _firstLabel.font = [UIFont boldSystemFontOfSize:15.f];
        [self.contentView addSubview:_firstLabel];
        
        [_firstImageView release];
        [_firstLabel release];
        
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    CGFloat height = self.contentView.frame.size.height;
    CGFloat width = self.contentView.frame.size.width;
    //图片和Button与Label之间有5个像素的空隙
    self.contentView.backgroundColor = [UIColor clearColor];
    _firstImageView.frame = CGRectMake(0, 0, width, height - 20);
    _firstButton.frame = CGRectMake(0, height - 15, 30, 15);
    _firstLabel.frame = CGRectMake(30, height - 15, width - 30, 15);
}

- (void)dealloc
{
    [_firstLabel release];
    [_firstImageView release];
    [super dealloc];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
